<?php


/*
添加好友或群组搜索处理页2015/9/22

注意功能：好友搜索不能找到自己
	群组搜索不能找到自己已经加入的群组
*/

include '../include/init.php';

$data=array();

$uid=trim($_POST['u']);
$type=trim($_POST['type']);
isset($_POST['keyword'])?$data['keyword']=trim($_POST['keyword']):'';

$offsetid=isset($_POST['offsetid'])?trim($_POST['offsetid']):0;
//$offset=isset($_POST['offset'])?trim($_POST['offset']):1;

$user=new userModel();


if($type=="frd")
{
	isset($_POST['online'])?$data['online']=trim($_POST['online']):'';
	isset($_POST['hascamera'])?$data['hascamera']=trim($_POST['hascamera']):'';
	isset($_POST['livetown'])?$data['livetown']=trim($_POST['livetown']):'';
	isset($_POST['hometown'])?$data['hometown']=trim($_POST['hometown']):'';
	isset($_POST['sex'])?$data['sex']=trim($_POST['sex']):'';
	isset($_POST['age'])?$data['age']=trim($_POST['age']):'';	
	
	$frds=$user->getfrdbycondition($uid,$data,$offsetid);
	if($frds)
	{
		echo json_encode($frds);
	}
	else
	{
		echo json_encode('no');
	}
	exit;

}
else if($data['type']=="frd")
{
		
}